<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActionView::Helpers::ActiveModelInstanceTag</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Module</span> 
            ActionView::Helpers::ActiveModelInstanceTag 
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../files/actionpack/lib/action_view/helpers/active_model_helper_rb.html">actionpack/lib/action_view/helpers/active_model_helper.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>C</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="ActiveModelInstanceTag.html#method-i-content_tag">content_tag</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>E</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="ActiveModelInstanceTag.html#method-i-error_message">error_message</a>,
              </li>
            
              
              <li>
                <a href="ActiveModelInstanceTag.html#method-i-error_wrapping">error_wrapping</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>O</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="ActiveModelInstanceTag.html#method-i-object">object</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>T</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="ActiveModelInstanceTag.html#method-i-tag">tag</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    


    


    <!-- Methods -->
        
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-content_tag">
            
              <b>content_tag</b>(*)
            
            <a href="ActiveModelInstanceTag.html#method-i-content_tag" name="method-i-content_tag" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-content_tag_source')" id="l_method-i-content_tag_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_view/helpers/active_model_helper.rb#L18" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-content_tag_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/helpers/active_model_helper.rb, line 18</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">content_tag</span>(*)
  <span class="ruby-identifier">error_wrapping</span>(<span class="ruby-keyword">super</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-error_message">
            
              <b>error_message</b>()
            
            <a href="ActiveModelInstanceTag.html#method-i-error_message" name="method-i-error_message" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-error_message_source')" id="l_method-i-error_message_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_view/helpers/active_model_helper.rb#L34" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-error_message_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/helpers/active_model_helper.rb, line 34</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">error_message</span>
  <span class="ruby-identifier">object</span>.<span class="ruby-identifier">errors</span>[<span class="ruby-ivar">@method_name</span>]
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-error_wrapping">
            
              <b>error_wrapping</b>(html_tag)
            
            <a href="ActiveModelInstanceTag.html#method-i-error_wrapping" name="method-i-error_wrapping" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-error_wrapping_source')" id="l_method-i-error_wrapping_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_view/helpers/active_model_helper.rb#L26" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-error_wrapping_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/helpers/active_model_helper.rb, line 26</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">error_wrapping</span>(<span class="ruby-identifier">html_tag</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">object_has_errors?</span>
    <span class="ruby-constant">Base</span>.<span class="ruby-identifier">field_error_proc</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">html_tag</span>, <span class="ruby-keyword">self</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">html_tag</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-object">
            
              <b>object</b>()
            
            <a href="ActiveModelInstanceTag.html#method-i-object" name="method-i-object" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-object_source')" id="l_method-i-object_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_view/helpers/active_model_helper.rb#L11" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-object_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/helpers/active_model_helper.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">object</span>
  <span class="ruby-ivar">@active_model_object</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">object</span> = <span class="ruby-keyword">super</span>
    <span class="ruby-identifier">object</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:to_model</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">to_model</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">object</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-tag">
            
              <b>tag</b>(type, options, *)
            
            <a href="ActiveModelInstanceTag.html#method-i-tag" name="method-i-tag" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-tag_source')" id="l_method-i-tag_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_view/helpers/active_model_helper.rb#L22" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-tag_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/helpers/active_model_helper.rb, line 22</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">tag</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span>, *)
  <span class="ruby-identifier">tag_generate_errors?</span>(<span class="ruby-identifier">options</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">error_wrapping</span>(<span class="ruby-keyword">super</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword">super</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    